<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //localStorage 存储数据   local  storage 存储
    localStorage.setItem('a', 100);
    localStorage.setItem('b', 100);

    //读取数据
    // console.log(localStorage.getItem('a'));

    //移除某个键的数据
    // localStorage.removeItem('a');

    setTimeout(() => {
      localStorage.clear();
    }, 2000)

  </script>
</body>
</html>